package com.web;

import com.pojo.dto.Message;
import com.pojo.vo.CommentVo;
import com.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CommentController {
    @Autowired
    CommentService commentService;

    @PostMapping("/comlist")
    public Message<List<CommentVo>> findList(CommentVo commentVo) {
        return commentService.list(commentVo);
    }

    @PostMapping("/comone")
    public Message<CommentVo> get(CommentVo commentVo) {
        return commentService.get(commentVo);
    }

    @PostMapping("/com/add")
    public Message<CommentVo> add(CommentVo commentVo) {
        return commentService.add(commentVo);
    }

    @PostMapping("/com/delete")
    public Message<CommentVo> delete(CommentVo commentVo) {
        return commentService.delete(commentVo);
    }

    @PostMapping("/com/edit")
    public Message<CommentVo> edit(CommentVo commentVo) {
        return commentService.edit(commentVo);
    }
}
